<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('用户优惠卷详情')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-discount_user-edit" th:object="${ddUserDiscount}">
            <input name="uuid" th:field="*{uuid}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠卷名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>

<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">模板ID：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="templateId" th:field="*{templateId}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">备用1：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="re1" th:field="*{re1}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">备用2：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="re2" th:field="*{re2}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">备用3：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="re3" th:field="*{re3}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否有效：</label>
                <div class="col-sm-8">
                    <input name="dateType"  th:value="${@dict.getLabel('discount_del',ddUserDiscount.del)}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">优惠额度：</label>
                <div class="col-sm-8 input-group">
                    <input name="quota" th:field="*{quota}" class="form-control" type="text">
                    <span class="input-group-addon">%</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">有效期模式：</label>
                <div class="col-sm-8">
                    <input name="dateType"  th:value="${@dict.getLabel('dd_discount',ddUserDiscount.dateType)}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">有效期起始日：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="beginTime" th:value="${#dates.format(ddUserDiscount.beginTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">有效期结束日：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="endTime" th:value="${#dates.format(ddUserDiscount.endTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
<!--            <div class="form-group" th:if="${ddUserDiscount.dateType} eq 1">-->
<!--                <label class="col-sm-3 control-label">到期时间：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="input-group date">-->
<!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--&lt;!&ndash;                        th:field="*{dateNumber}"&ndash;&gt;-->
<!--                        <input name="dateNumber" th:value="${#dates.format(ddUserDiscount.beginTime, 'yyyy-MM-dd')}"  placeholder="yyyy-MM-dd" class="form-control" type="text">-->
<!--                        <input name="beginTime"  class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remake" th:field="*{remake}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "system/discount_user";
        var endTime = [[${ddUserDiscount.dateNumber}]]
        if(endTime!=null){

        }
        $("#form-discount_user-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-discount_user-edit').serialize());
            }
        }

        $("input[name='beginTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>